package com.fr.base.core.antlr;

import com.fr.base.core.antlr.collections.AST;

public class NoViableAltException extends RecognitionException
{
  public Token token;
  public AST node;

  public NoViableAltException(AST paramAST)
  {
    super("NoViableAlt", "<AST>", paramAST.getLine(), paramAST.getColumn());
    this.node = paramAST;
  }

  public NoViableAltException(Token paramToken, String paramString)
  {
    super("NoViableAlt", paramString, paramToken.getLine(), paramToken.getColumn());
    this.token = paramToken;
  }

  public String getMessage()
  {
    if (this.token != null)
      return "unexpected token: " + this.token.getText();
    if (this.node == TreeParser.ASTNULL)
      return "unexpected end of subtree";
    return "unexpected AST node: " + this.node.toString();
  }
}